﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;


namespace HAVNet.CoreTesting
{
    namespace Porotox
    { 
    
    }
    
    delegate void Dele0 ();
    delegate void Dele1 (int x);
    delegate void Dele2 (ref int x);
    delegate void Dele3 (out int x);

    class PruebaPrimLit
    {
        class MyArray : IEnumerable<int>
        {
            public IEnumerator<int> GetEnumerator()
            {
                throw new NotImplementedException();
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                throw new NotImplementedException();
            }

            public void Add(int x)
            {
                ;
            }
        }

        class Coca
        {
            public int edad { get; set; }
            public string nombre { get; set; }

            public static int unMetodo()
            {
                return 1;
            }
        }

        public void func ()
        {
            var a = 10;
            var b = 10.0;
            var c = 10.0f;
            var d = 0xFF;
            var e = "hola";
            var f = "\\storage card\\tecnobus\\";
            var g = @"c:\cadena\verbatim";
            var h = (int)(10);
            var i = this;
            var j = checked     (a + 1000000000);
            var k = unchecked   (a - 1000);
            bool l= default     (bool);
            int m = sizeof      (bool);
            Type n= typeof      (float);

            Dele0 s = delegate {
                int ex = 10;
            };

            Dele0 o = delegate () { 
                int ax = 10;
            };

            Dele1 p = delegate (int x) {
                x = x + 1;
            };

            Dele2 q = delegate (ref int x) {
                x = x + 1;
            };

            Dele3 r = delegate (out int x) {
                x = 0;
            };

            int cc = Coca.unMetodo();

            // explicit typed lambda expression...
            HAVNet.Core.Lambda.Func<int> aa = () => 1;
            HAVNet.Core.Lambda.Func<int> ab = () => { int xxx = 2 * 4; return xxx / 2 / 3 / 4; };
            HAVNet.Core.Lambda.Func<int, int> ac = (int iri) => { return iri / 17 / 18 / 19; };

            // implicit typed lambda expression... /* TODO: ! */
            HAVNet.Core.Lambda.Func<int, int> ad = 
                x => x + 1;

            var ultima = 2 << 3 / 4 + 1 - 5 * 3 - (8 >> 9) / 5 >> 1;
            var ultimb = 2 > 3;
            var ultimc = 4 <= 5 - 7 >> 2;
            var ultimd = 1 == 2;
            var ultime = 2 != 4;
            var ultimf = 2 & 4;
            var ultimg = 2 ^ 4;
            var ultimh = 2 | 3;
            var ultimi = true && false;
            var ultimj = false || false;
            var ultimk = null ?? "";

            var ultiml = -1;
            var ultimm = "hola" + " " + "mundo" + "!" + "\n";

            var ultimn = true || true && false ? false : true;

            int ultimo = 0;
            ultimo += 10;
            ultimo *= 7;
            ultimo /= 34;

            bool pepiloide = false;

            if (pepiloide = true || false)
                ;

            if ((ultimo &= 1) == 7)
                ;

            bool parara = (DateTime.Now.Minute == 17 ? true : false);
            string pororo = ("nautilo".Length > 18 ? "zorongo" : "tara");

            int piriri = 0;
            piriri--;

            byte[] pururu = new byte[10];
            pururu[0] = (byte) 1;
            pururu[1] = (byte) 1;
            pururu[2] = (byte) 1;
            pururu[3] = (byte) 1;
            pururu[(int)Math.Abs(3>>1)] = (byte)1;

            var inst0 = new Coca { edad = 10, nombre = "Piololo", };
            var inst1 = new Coca { edad = 10, nombre = "Piololo" };
            var inst2 = new Coca () { edad = 10, nombre = "Piololo" };

            byte joto = 0;

            byte[]      array0 = new[]          { (byte)1, (byte)2, (byte)3 };
            byte[]      array1 = new byte[]     { 1, 2, 3, 4, 5 };
            byte[]      array2 = new byte[2]    { 1, 1 };
            byte[,]     array3 = new byte[,]    { { 1, 1, 8 }, { 2, 2, 6 }, { 3, 3, 5 } };
            byte[,]     array4 = new byte[2, 2] { { 1, joto=1 }, { 2, 2 } };
            byte[][]    array5 = new byte[][]   { new byte[] { 1, 2 }, new byte[] { 3, 4, 5 }, new byte[] { 1 } };
            byte[][]    array6 = new byte[2][]  { new byte[] { 1, 2, 6, 7 }, new byte[] { 4, 5 } };
            byte[][,]   array7 = new byte[][,]  { new byte[,] { { 1 }, { 1 } }, new byte[,] { { 1 }, { 1 } }, new byte[,] { { 1 }, { 1 } } };
            MyArray     array8 = new MyArray    { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, };
        }
    }
}
